import { BaseModel } from './BaseModel.js';
import { dataFiles } from '../config/database.js';

const defaultMarketingDepartment = [
  {
    id: 1,
    name: '市场一部',
    manager: '张经理',
    phone: '13800138001',
    gender: 'male'
  },
  {
    id: 2,
    name: '市场二部',
    manager: '李主任',
    phone: '13800138002',
    gender: 'female'
  }
];

export class MarketingDepartment extends BaseModel {
  constructor() {
    super(dataFiles.marketingDepartment, defaultMarketingDepartment);
  }

  findByName(name) {
    return this.findOne({ name });
  }
}